package esempio.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="ITEM_BOOKING")
public class ItemBooking {
	private long itmBookingId;
	private int quantity;
	private float totalPriceItem;
	private Vehicle vehicle;
	private Booking booking;
	
	public ItemBooking() {	}
	
	
	public ItemBooking(int quantity, float totalPriceItem, Vehicle vehicle,
			Booking booking) {
		this.quantity = quantity;
		this.totalPriceItem = totalPriceItem;
		this.vehicle = vehicle;
		this.booking = booking;
	}


	@Id
	@GeneratedValue
	@Column(name="ITEM_BOOKING_ID")
	public long getItmBookingId() {
		return itmBookingId;
	}
	public void setItmBookingId(long itmBookingId) {
		this.itmBookingId = itmBookingId;
	}
	@Column(name="QUANTITY")
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	@Column(name="TOTAL_PRICE_ITEM")
	public float getTotalPriceItem() {
		return totalPriceItem;
	}
	public void setTotalPriceItem(float totalPriceItem) {
		this.totalPriceItem = totalPriceItem;
	}
	@ManyToOne(cascade = CascadeType.ALL)
	public Vehicle getVehicle() {
		return vehicle;
	}
	public void setVehicle(Vehicle vehicle) {
		this.vehicle = vehicle;
	}

	@ManyToOne(cascade = CascadeType.ALL)
	public Booking getBooking() {
		return booking;
	}


	public void setBooking(Booking booking) {
		this.booking = booking;
	}
	
	
	
}
